package com.example.interceptmybatis.config;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @ClassName ExceptionHandler
 * @Description TODO
 * @Author 郭敖
 * @Date 2024年09月05日 21:48
 * @Version 1.0
 */
@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result handleException(Exception e){
        return new Result().setCode(500).setMsg(e.getMessage());
    }
}
